package magicsquare;

public class Ctx {
	public static int squareBase = -1;
	public static int rowSum = -1;
	
	public static int fisrtNumber = 1;
	public static int lasNumber = -1;
	
	public static int fisrtBit = 0;
	public static int lasBit = -1;
	
	public static int[] tmpBuf;
	public static RowSequences rowSequences;
	
	private Ctx() {}
	
	public static void init(int _squareBase) {
		squareBase = _squareBase;
		lasNumber =  squareBase * squareBase;
		rowSum = (lasNumber + 1) * lasNumber / (2 * squareBase);
		lasBit = lasNumber - 1;
		tmpBuf = new int[squareBase];
		rowSequences = null;
	}
	
	public static void printCtx() {
		print("CONTEX BASE " + squareBase);
		print("lasNumber = " +lasNumber);
		print("rowSum = " +rowSum);
	}
	
	public static void printDebug(final Object l) {
		print("{DEBUG} " + l);
	}
	public static void print(final Object l) {
		System.out.println(l);
	}
}
